package cn.example.vip.mall.user.service.impl;

import cn.example.vip.mall.user.entity.Address;
import cn.example.vip.mall.user.mapper.AddressMapper;
import cn.example.vip.mall.user.service.AddressService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AddressServiceImpl extends ServiceImpl<AddressMapper, Address> implements AddressService {
	@Autowired
	private AddressMapper addressMapper;
	
	@Override
	public List<Address> listByUserName(String userName) {
		QueryWrapper<Address> queryWrapper = new QueryWrapper<>();
		queryWrapper.eq("username", userName);
		return addressMapper.selectList(queryWrapper);
	}
}
